import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/1'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/1',
                    component: resolve => require(['../components/page/'], resolve),
                    meta: { title: '首页' }
                },
                {
                    path: '/2',
                    component: resolve => require(['../components/page/Icon.vue'], resolve),
                    meta: { title: '文件结构' }
                },
                {
                    path: '/3',
                    component: resolve => require(['../components/page/BaseTable.vue'], resolve),
                    meta: { title: '标签抽取' }
                },
                {
                    path: '/4',
                    component: resolve => require(['../components/page/Tabs.vue'], resolve),
                    meta: { title: '实体归类' }
                },
                {
                    path: '/5',
                    component: resolve => require(['../components/page/BaseForm.vue'], resolve),
                    meta: { title: '实体关联' }
                },
                {
                    // 富文本编辑器组件
                    path: '/6',
                    component: resolve => require(['../components/page/VueEditor.vue'], resolve),
                    meta: { title: '知识聚集' }
                },
                {
                    // vue-schart组件
                    path: '/7',
                    component: resolve => require(['../components/page/BaseCharts.vue'], resolve),
                    meta: { title: '知识图谱可视化' }
                },
                {
                    path: '/404',
                    component: resolve => require(['../components/page/404.vue'], resolve),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: resolve => require(['../components/page/403.vue'], resolve),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
